home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / haskell.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  7KB  |  125 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!DOCTYPE MODE SYSTEM "xmode.dtd">
  4.  
  5. <!--
  6.     Haskell mode by Stephen Blackheath
  7. -->
  8.  
  9. <MODE>
  10.  
  11.     <PROPS>
  12.         <PROPERTY NAME="commentStart" VALUE="{-" />
  13.         <PROPERTY NAME="commentEnd" VALUE="-}" />
  14.         <PROPERTY NAME="lineComment" VALUE="--" />
  15.     </PROPS>
  16.  
  17.     <RULES IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="FALSE">
  18.         <!-- Pragmas. -->
  19.         <SPAN TYPE="COMMENT2">
  20.             <BEGIN>{-#</BEGIN>
  21.             <END>#-}</END>
  22.         </SPAN>
  23.  
  24.         <SPAN TYPE="COMMENT1">
  25.             <BEGIN>{-</BEGIN>
  26.             <END>-}</END>
  27.         </SPAN>
  28.  
  29.         <EOL_SPAN TYPE="COMMENT1">--</EOL_SPAN>
  30.  
  31.         <SPAN TYPE="LITERAL1" ESCAPE="\" NO_LINE_BREAK="TRUE">
  32.             <BEGIN>"</BEGIN>
  33.             <END>"</END>
  34.         </SPAN>
  35.  
  36.         <SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
  37.             <BEGIN>'</BEGIN>
  38.             <END>'</END>
  39.         </SPAN>
  40.  
  41.                 <!-- Reserved words. -->
  42.                 <SEQ_REGEXP TYPE="KEYWORD1">case(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  43.                 <SEQ_REGEXP TYPE="KEYWORD1">class(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  44.                 <SEQ_REGEXP TYPE="KEYWORD1">data(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  45.                 <SEQ_REGEXP TYPE="KEYWORD1">default(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  46.                 <SEQ_REGEXP TYPE="KEYWORD1">deriving(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  47.                 <SEQ_REGEXP TYPE="KEYWORD1">do(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  48.                 <SEQ_REGEXP TYPE="KEYWORD1">else(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  49.                 <SEQ_REGEXP TYPE="KEYWORD1">if(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  50.                 <SEQ_REGEXP TYPE="KEYWORD1">import(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  51.                 <SEQ_REGEXP TYPE="KEYWORD1">in(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  52.                 <SEQ_REGEXP TYPE="KEYWORD1">infix(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  53.                 <SEQ_REGEXP TYPE="KEYWORD1">infixl(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  54.                 <SEQ_REGEXP TYPE="KEYWORD1">infixr(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  55.                 <SEQ_REGEXP TYPE="KEYWORD1">instance(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  56.                 <SEQ_REGEXP TYPE="KEYWORD1">let(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  57.                 <SEQ_REGEXP TYPE="KEYWORD1">module(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  58.                 <SEQ_REGEXP TYPE="KEYWORD1">newtype(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  59.                 <SEQ_REGEXP TYPE="KEYWORD1">of(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  60.                 <SEQ_REGEXP TYPE="KEYWORD1">then(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  61.                 <SEQ_REGEXP TYPE="KEYWORD1">type(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  62.                 <SEQ_REGEXP TYPE="KEYWORD1">where(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  63.                 <SEQ_REGEXP TYPE="KEYWORD1">_(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  64.                 <SEQ_REGEXP TYPE="KEYWORD1">as(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  65.                 <SEQ_REGEXP TYPE="KEYWORD1">qualified(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  66.                 <SEQ_REGEXP TYPE="KEYWORD1">hiding(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  67.                 <!-- Non-Haskell-98 keywords -->
  68.                 <SEQ_REGEXP TYPE="KEYWORD1">foreign(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  69.                 <SEQ_REGEXP TYPE="KEYWORD1">family(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  70.                 <!-- GHC extension keywords -->
  71.                 <SEQ_REGEXP TYPE="KEYWORD1">proc(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  72.                 <SEQ_REGEXP TYPE="KEYWORD1">rec(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  73.                 <SEQ_REGEXP TYPE="KEYWORD1">mdo(?![a-z_A-Z0-9'])</SEQ_REGEXP>
  74.  
  75.                 <SEQ_REGEXP TYPE="DIGIT">0[xXoO][0-9a-fA-F]+</SEQ_REGEXP>
  76.                 <SEQ_REGEXP TYPE="DIGIT">[0-9]+(\.[0-9]+)?([eE][+-]?[0-9]+)?</SEQ_REGEXP>
  77.                 
  78.                 <!-- Reserved operators -->
  79.                 <SEQ_REGEXP TYPE="KEYWORD4">\.\.(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  80.                 <SEQ_REGEXP TYPE="KEYWORD4">:(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  81.                 <SEQ_REGEXP TYPE="KEYWORD4">::(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  82.                 <SEQ_REGEXP TYPE="KEYWORD4">=(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  83.                 <SEQ TYPE="KEYWORD4">\</SEQ>
  84.                 <SEQ_REGEXP TYPE="KEYWORD4">\|(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  85.                 <SEQ_REGEXP TYPE="KEYWORD4"><-(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  86.                 <SEQ_REGEXP TYPE="KEYWORD4">->(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  87.                 <SEQ_REGEXP TYPE="KEYWORD4">@(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  88.                 <SEQ_REGEXP TYPE="KEYWORD4">~(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  89.                 <SEQ_REGEXP TYPE="KEYWORD4">=>(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  90.  
  91.                 <!-- GHC extension reserved operators -->
  92.                 <SEQ_REGEXP TYPE="KEYWORD4">-(<{1,2})(?![!#$%&\*+\./<=>?@\\\^\|\-~:])</SEQ_REGEXP>
  93.  
  94.                 <!-- Normal operators, backquoted operators -->
  95.                 <SEQ_REGEXP TYPE="OPERATOR">([A-Z][a-z_A-Z0-9']*\.)*[!#$%&\*+\./<=>?@\\\^\|\-~][!#$%&\*+\./<=>?@\\\^\|\-~:]*</SEQ_REGEXP>
  96.                 <SEQ_REGEXP TYPE="OPERATOR">`([A-Z][a-z_A-Z0-9']*\.)*[a-z_][a-z_A-Z0-9']*`</SEQ_REGEXP>
  97.  
  98.                 <!-- variable/function (qualified or not) -->
  99.                 <SEQ_REGEXP TYPE="NULL">([A-Z][a-z_A-Z0-9']*\.)*[a-z_][a-z_A-Z0-9']*</SEQ_REGEXP>
  100.                 <!-- contructor/type (qualified or not) -->
  101.                 <SEQ_REGEXP TYPE="KEYWORD2">[A-Z][a-z_A-Z0-9']*(\.[A-Z][a-z_A-Z0-9']*)*</SEQ_REGEXP>
  102.  
  103.                 <!-- Operators in parentheses appear like functions, but this
  104.                     doesn't match the special case of (..) used for imports -->
  105.                 <SEQ_REGEXP TYPE="NULL">\(\s*([A-Z][a-z_A-Z0-9']*\.)*[!#$%&\*+\./<=>?@\\\^\|\-~]\s*\)</SEQ_REGEXP>
  106.                 <SEQ_REGEXP TYPE="NULL">\(\s*([A-Z][a-z_A-Z0-9']*\.)*[!#$%&\*+\./<=>?@\\\^\|\-~][!#$%&\*+/<=>?@\\\^\|\-~:][!#$%&\*+\./<=>?@\\\^\|\-~:]*\s*\)</SEQ_REGEXP>
  107.                 <SEQ_REGEXP TYPE="NULL">\(\s*([A-Z][a-z_A-Z0-9']*\.)*[!#$%&\*+/<=>?@\\\^\|\-~][!#$%&\*+\./<=>?@\\\^\|\-~:][!#$%&\*+\./<=>?@\\\^\|\-~:]*\s*\)</SEQ_REGEXP>
  108.                 <SEQ_REGEXP TYPE="NULL">\(\s*([A-Z][a-z_A-Z0-9']*\.)*[!#$%&\*+\./<=>?@\\\^\|\-~][!#$%&\*+\./<=>?@\\\^\|\-~:]{2,}\)</SEQ_REGEXP>
  109.  
  110.                 <!-- Infix constructors -->
  111.                 <SEQ_REGEXP TYPE="KEYWORD2">([A-Z][a-z_A-Z0-9']*\.)*:[!#$%&\*+\./<=>?@\\\^\|\-~:]*</SEQ_REGEXP>
  112.                 <!-- Infix constructors in parentheses -->
  113.                 <SEQ_REGEXP TYPE="KEYWORD2">\(\s*([A-Z][a-z_A-Z0-9']*\.)*:[!#$%&\*+\./<=>?@\\\^\|\-~:]*\s*\)</SEQ_REGEXP>
  114.  
  115.                 <!-- (, including the specific case of (..) but excluding all other cases
  116.                     where it's an operator in parentheses -->
  117.                 <SEQ_REGEXP TYPE="KEYWORD3">\((?!\s*([!#$%&\*+\./<=>?@\\\^\|\-~]\s*\)|[!#$%&\*+\./<=>?@\\\^\|\-~][!#$%&\*+/<=>?@\\\^\|\-~:][!#$%&\*+\./<=>?@\\\^\|\-~:]*\s*\)|[!#$%&\*+/<=>?@\\\^\|\-~][!#$%&\*+\./<=>?@\\\^\|\-~:][!#$%&\*+\./<=>?@\\\^\|\-~:]*\s*\)|[!#$%&\*+\./<=>?@\\\^\|\-~][!#$%&\*+\./<=>?@\\\^\|\-~:]{2,}\s*\)))</SEQ_REGEXP>
  118.                 <SEQ TYPE="KEYWORD3">)</SEQ>
  119.                 <SEQ TYPE="KEYWORD3">,</SEQ>
  120.                 <SEQ TYPE="KEYWORD3">[</SEQ>
  121.                 <SEQ TYPE="KEYWORD3">]</SEQ>
  122.     </RULES>
  123.  
  124. </MODE>
  125.